﻿using System.Collections.Generic;

namespace ContentAppBase.Model
{
    public class GroupInfoList<T> : List<object>
    {
        public object Key { get; set; }
        public bool IsImage { get; set; }
        public bool ShowKey { get; set; }

        public new IEnumerator<object> GetEnumerator()
        {
            return (System.Collections.Generic.IEnumerator<object>)base.GetEnumerator();
        }

        public GroupInfoList()
        {
            ShowKey = true;
        }

        public GroupInfoList(string key, IEnumerable<object> list)
        {
            ShowKey = true;
            Key = key;

            if (list != null)
            {
                foreach (var item in list)
                {
                    this.Add(item);
                }
            }
        }

        public GroupInfoList(string key, object content, bool isImage = false, bool showKey = true)
        {
            ShowKey = showKey;
            Key = key;
            IsImage = isImage;
            this.Add(content);
        }
    }
}
